package com.yanfan;

import com.alibaba.fastjson2.JSONObject;
import com.yanfan.common.utils.Md5Utils;
import com.yanfan.common.utils.StringUtils;
import com.yanfan.ibms.common.utils.HttpUtils2;
import org.junit.jupiter.api.Test;

import java.util.HashMap;

public class Main {
    /**
     * 信息发布
     * @param
     */
    @Test
    public void getTicket() {
        String md5 = Md5Utils.md5("admin12345");
        HashMap<String, Object> map = new HashMap<>();
        map.put("user","root");
        map.put("pwd",md5);
        map.put("action","getticket");
        JSONObject jsonObject = HttpUtils2
                .sendSSLGet("https://192.168.254.8:8443/dmb/out/sso.jsp",
                        "user=root&pwd="+ md5 +"&action=getticket");
        System.out.println(jsonObject);
        String ticket = jsonObject.get("ticket").toString();
        System.out.println("http://192.168.254.8:8080/dmb/j_acegi_security_check?ticket=" + ticket);
        //return "http://192.168.254.8:8080/dmb/j_acegi_security_check?ticket=" + ticket;
    }
}
